﻿<!DOCTYPE html>
<!--选择排查内容-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <script>

    </script>
</head>
<body>
    <div id="app" v-cloak class="popupW100">
        <el-row>
            <el-col :span="24">
                <el-form label-position="right" :rules="rules" ref="ruleForm" :inline="true" :model="formInline" class="demo-form-inline" style="margin-bottom: 15px;">
                    <el-row>
                        <el-col class="head-tool">
                            <span>
                                <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="4"
                                    @click="onSubmit"></btn>
                            </span>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.Plan" :placeholder="RisksManagement.RiskReport.Plan" size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.RiskReport.Plan+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                    </el-row>


                    <el-table stripe ref="table" :data="ListItem.tableData"
                              :height="ListItem.tableHeight"
                              border
                              highlight-current-row
                              @current-change="handleSelectionChange"
                              row-style="height:10px"
                              style="width: 100%">
                        <!--@selection-change="handleSelectionChange"-->
                        <!--<el-table-column type="selection" align="center" width="55">
                        </el-table-column>-->
                        <el-table-column prop="id"
                                         :label="RisksManagement.RiskReport.id"
                                         width="180">
                            <template slot-scope="scope">
                                {{scope.row.id}}
                            </template>
                        </el-table-column>
                        <el-table-column prop="Plan"
                                         :label="RisksManagement.RiskReport.Plan">
                        </el-table-column>
                    </el-table>
                    <el-row type="flex" justify="end">
                        <el-pagination ref="page" @size-change="handleSizeChange"
                                       @current-change="handleCurrentChange"
                                       :current-page="ListItem.currentPage"
                                       :page-sizes="ListItem.pagesizes"
                                       :page-size="ListItem.pagesize"
                                       :layout="ListItem.layout"
                                       :total="ListItem.total">
                        </el-pagination>

                    </el-row>
                    <el-row type="flex" justify="end">
                        <el-form-item>
                            <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnConfirm}}</el-button>
                            <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                        </el-form-item>
                    </el-row>
                </el-form>
            </el-col>

        </el-row>

    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',

            data: function () {
                return {
                    //页面内数据初始化
                    ListItem: ListItem,
                    formInline: {
                        model: {
                            Plan: '',
                            RiskRegion: '',
                            RiskPosition: '',
                        },
                        offset: 0,
                        limit: 10
                    },
                    rules: {

                    }
                }
            },
            created: function () {
                var currApp = this;
                window.onresize = function () {
                    currApp.ListItem.tableHeight = window.innerHeight -
                        currApp.$refs.table.$el.offsetTop - 60;
                    if (currApp.ListItem.tableHeight < 112) {
                        currApp.ListItem.tableHeight = 112;
                    }
                }
            },
            mounted: function () {
                this.formInline.RiskRegion = getUrlParam("region");
                this.formInline.RiskPosition = getUrlParam("position");

                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            $.extend(true, parent.app.Form, mythis.ListItem.tableMultipleSelection)
                           

                            //myAjax("post", mythis, '/api/RiskContent/SaveInputTable', mythis.Form, function (response) {
                            //    showMessage(msg.OperatingOk, 'success');
                            parent.app.ListItem.dialogVisible = false;
                            //});
                            //parent.closeDialog();
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/RiskReport/GetPlanSelectList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); }
            }
        });

    </script>
</body>
</html>